<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8"/>
  <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
  <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
  <title>Document</title>
</head>
<body>
<div id="app">
  <label for="male" >
    <input type="radio" id="male"  v-model="sex" value="1">男
  </label>

  <label for="female" >
<!--    档v-model绑定了相同的变量，name是可以省略的-->
<!--    如果想要设定默认值，可以在data中直接给变量附上初始的值-->
    <input type="radio" id="female" name="sex" v-model="sex"value="2">女
  </label>
  {{sex}}
</div>
<script src="../node_modules/vue/dist/vue.js"></script>
<script>
  new Vue({
    el: "#app",
    data: {
      msg: "hello,world",
      sex: ''
    },
  });
</script>
</body>
</html>
